import { MockMethod } from 'vite-plugin-mock'

const dict = {
  // 用户性别字典表
  user_sex: {
    data: [{
      "status": "1",
      "createBy": "123",
      "createTime": "2020-10-02 15:40:07",
      "deleteStatus": "1",
      "id": "160165320700536",
      "dictType": "user_sex",
      "dictValue": "0",
      "dictLabel": "女",
      "orderNum": "2"
    }, {
      "status": "1",
      "createBy": "123",
      "createTime": "2020-10-02 15:42:00",
      "deleteStatus": "1",
      "id": "160165331966815",
      "dictType": "user_sex",
      "dictValue": "1",
      "dictLabel": "男",
      "orderNum": "1"
    }, {
      "status": "1",
      "createBy": "123",
      "createTime": "2020-10-02 15:42:08",
      "deleteStatus": "1",
      "id": "160165332821027",
      "dictType": "user_sex",
      "dictValue": "2",
      "dictLabel": "未知"
    }]
  },
  // 用户状态字典表
  status_normal: {
    data: [{
      "status": "1",
      "createBy": "123",
      "createTime": "2020-10-01 18:13:18",
      "deleteStatus": "1",
      "id": "160157600995579",
      "dictType": "status_normal",
      "dictValue": "1",
      "dictLabel": "正常"
    }, {
      "status": "1",
      "createBy": "123",
      "createTime": "2020-10-01 18:13:30",
      "deleteStatus": "1",
      "id": "160157600995601",
      "dictType": "status_normal",
      "dictValue": "0",
      "dictLabel": "停用"
    }],
  },
  // 显示或隐藏
  is_visible: {
    data: [{
      "status": "1",
      "createBy": "123",
      "createTime": "2020-10-02 16:17:13",
      "deleteStatus": "1",
      "id": "160165543282183",
      "dictType": "is_visible",
      "dictValue": "1",
      "dictLabel": "显示"
    }, {
      "status": "1",
      "createBy": "123",
      "createTime": "2020-10-02 16:17:21",
      "deleteStatus": "1",
      "id": "160165544106729",
      "dictType": "is_visible",
      "dictValue": "0",
      "dictLabel": "隐藏"
    }]
  },
  // 成败状态
  success_status: {
    data: [{
      dictValue: '1',
      dictLabel: '成功',
      type: 'success',
      status: '1'
    }, {
      dictValue: '0',
      dictLabel: '失败',
      type: 'danger',
      status: '1'
    }]
  },
  // http请求方式
  http_method: {
    data: [{
      dictValue: '1',
      dictLabel: 'GET',
      status: '1'
    }, {
      dictValue: '2',
      dictLabel: 'POST',
      status: '1'
    }, {
      dictValue: '3',
      dictLabel: 'PUT',
      status: '1'
    }, {
      dictValue: '4',
      dictLabel: 'DELETE',
      status: '1'
    }, {
      dictValue: '5',
      dictLabel: 'PATCH',
      status: '1'
    }]
  },
  operationType: {
    data: [{
      dictValue: '1',
      dictLabel: '新增',
      status: '1'
    }, {
      dictValue: '2',
      dictLabel: '修改',
      status: '1'
    }, {
      dictValue: '3',
      dictLabel: '删除',
      status: '1'
    }]
  },
  notice_type: {
    data: [{
      "status": "0",
      "createBy": "123",
      "createTime": "2021-01-10 12:46:26",
      "deleteStatus": "1",
      "id": "161028278554359",
      "dictType": "notice_type",
      "dictValue": "1",
      "dictLabel": "通知",
      "orderNum": "1"
    }, {
      "status": "1",
      "createBy": "123",
      "createTime": "2021-01-10 12:46:44",
      "deleteStatus": "1",
      "id": "161028280419722",
      "dictType": "notice_type",
      "dictValue": "2",
      "dictLabel": "公告",
      "orderNum": "2"
    }]
  }

  // 点击轮播图是否打开新窗口
  // open_target: {
  //   data: [{
  //     dictValue: '1',
  //     dictLabel: '是',
  //     status: '1'
  //   }, {
  //     dictValue: '0',
  //     dictLabel: '否',
  //     status: '1'
  //   }]
  // }
}

const dictTypeList = [{
  "status": "1",
  "createBy": "123",
  "createTime": "2021-01-17 11:01:23",
  "deleteStatus": "1",
  "id": "161088128330845",
  "dictName": "显示类型",
  "dictType": "show_type"
}, {
  "status": "1",
  "createBy": "123",
  "createTime": "2021-01-17 10:49:13",
  "deleteStatus": "1",
  "id": "161088055295506",
  "dictName": "成功状态",
  "dictType": "success_status"
}, {
  "status": "1",
  "createBy": "123",
  "createTime": "2021-01-10 12:45:59",
  "deleteStatus": "1",
  "remark": "系统发布的公告类型",
  "id": "161028275871236",
  "dictName": "公告类型",
  "dictType": "notice_type"
}, {
  "status": "1",
  "createBy": "123",
  "createTime": "2020-10-06 16:04:05",
  "updateBy": "3123",
  "updateTime": "2020-10-06 16:05:21",
  "deleteStatus": "1",
  "remark": "点击图片是否打开新标签页",
  "id": "160200024512550",
  "dictName": "打开新窗口",
  "dictType": "open_new_target"
}, {
  "status": "1",
  "createBy": "123",
  "createTime": "2020-10-02 16:14:24",
  "updateBy": "3123",
  "updateTime": "2020-11-22 15:14:07",
  "deleteStatus": "1",
  "id": "160165526365626",
  "dictName": "启停状态",
  "dictType": "status_normal"
}, {
  "status": "1",
  "createBy": "123",
  "createTime": "2020-10-02 05:41:14",
  "deleteStatus": "1",
  "id": "160161727373554",
  "dictName": "是否显示",
  "dictType": "is_visible"
}, {
  "status": "1",
  "createBy": "123",
  "createTime": "2020-10-02 05:06:58",
  "deleteStatus": "1",
  "remark": "用来表示用户性别",
  "id": "160161521825215",
  "dictName": "用户性别",
  "dictType": "user_sex"
}]

const dictInfoList = [{
  "status": "1",
  "createBy": "123",
  "createTime": "2021-01-17 11:01:59",
  "deleteStatus": "1",
  "id": "161088131900688",
  "dictType": "show_type",
  "dictValue": "1",
  "dictLabel": "success",
  "orderNum": "1"
}, {
  "status": "1",
  "createBy": "123",
  "createTime": "2021-01-17 11:03:12",
  "deleteStatus": "1",
  "id": "161088139249772",
  "dictType": "show_type",
  "dictValue": "0",
  "dictLabel": "danger",
  "orderNum": "2"
}, {
  "status": "1",
  "createBy": "123",
  "createTime": "2021-01-17 11:03:25",
  "deleteStatus": "1",
  "id": "161088140480170",
  "dictType": "show_type",
  "dictValue": "2",
  "dictLabel": "primary ",
  "orderNum": "3"
}, {
  "status": "1",
  "createBy": "123",
  "createTime": "2021-01-17 11:03:33",
  "deleteStatus": "1",
  "id": "161088141308627",
  "dictType": "show_type",
  "dictValue": "3",
  "dictLabel": "warning ",
  "orderNum": "4"
}, {
  "status": "1",
  "createBy": "123",
  "createTime": "2021-01-17 11:03:46",
  "deleteStatus": "1",
  "id": "161088142567023",
  "dictType": "show_type",
  "dictValue": "4",
  "dictLabel": "info",
  "orderNum": "5"
}, {
  "status": "1",
  "createBy": "123",
  "createTime": "2021-01-17 11:03:56",
  "deleteStatus": "1",
  "id": "161088143559324",
  "dictType": "show_type",
  "dictValue": "5",
  "dictLabel": "text",
  "orderNum": "6"
}]

export default [
  {
    url: '/mock/system/dict/info/dictType/user_sex',
    method: 'get',
    response: ({ query,data }) => {
      return {
        code: 200,
        data: dict['user_sex'].data,
        message: ''
      }
    }
  }, {
    url: '/mock/system/dict/info/dictType/status_normal',
    method: 'get',
    response: ({ query,data }) => {
      return {
        code: 200,
        data: dict['status_normal'].data,
        message: ''
      }
    }
  }, {
    url: '/mock/system/dict/info/dictType/is_visible',
    method: 'get',
    response: ({ query,data }) => {
      return {
        code: 200,
        data: dict['is_visible'].data,
        message: ''
      }
    }
  }, {
    url: '/mock/system/dict/info/dictType/notice_type',
    method: 'get',
    response: ({ query,data }) => {
      return {
        code: 200,
        data: dict['notice_type'].data,
        message: ''
      }
    }
  }, {
    url: '/mock/system/dict/type/list', // 点击菜单“字典管理”出现的列表
    method: 'get',
    response: ({ query,data }) => {
      return {
        code: 200,
        data: dictTypeList,
        message: '',
        total: 7
      }
    }
  }, {
    url: '/mock/system/dict/info/list', // 点击字典列表中某一项的名称后出现的列表
    method: 'get',
    response: ({ query,data }) => {
      return {
        code: 200,
        data: dictInfoList,
        message: '',
        total: 6
      }
    }
  }
] as MockMethod[]